﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MercuryRobot
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            serialPort1.Write("a");
            //textBox1.Text = serialPort1.ReadLine();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            serialPort1.PortName = "COM1";
            serialPort1.Open();
            //textBox1.Text = serialPort1.ReadExisting();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            serialPort1.Write("w");
            //textBox1.Text = serialPort1.ReadLine();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            serialPort1.Write("s");
            //textBox1.Text = serialPort1.ReadLine();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            serialPort1.Write("d");
            //textBox1.Text = serialPort1.ReadLine();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            webBrowser1.Refresh();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            serialPort1.PortName = "COM2";
            serialPort1.Open();
           // textBox1.Text = serialPort1.ReadExisting();
        }

        private void button8_Click(object sender, EventArgs e)
        {
            serialPort1.PortName = "COM3";
            serialPort1.Open();
           // textBox1.Text = serialPort1.ReadExisting();
        }

        private void button9_Click(object sender, EventArgs e)
        {
            textBox1.Text = serialPort1.ReadExisting();
        }
    }
}
